package STUDENT.TRINHQUANGXUANDUC.OPPS.baitapmang.bai6;

import java.util.Scanner;

public class Views {
	public static void main(String[] args) {
		Controllers svControllers = new Controllers();
		Scanner sc = new Scanner(System.in);
		System.out.println("Nhap so sinh vien:");
		Student[] students = new Student[sc.nextInt()];
		Student studentsobj = null;
		for (int i = 0; i < students.length; i++) {
			System.out.println("Nhap ten sinh vien:");
			sc = new Scanner(System.in);
			String ten = sc.nextLine();
			sc = new Scanner(System.in);
			System.out.println("Nhap diem cua sinh vien");
			double diem = sc.nextDouble();
			studentsobj = new Student(ten, diem);
			students[i] = studentsobj;
		}
		printArray(students);
	}

	/***
	 * Phuong thuc in danh sach sinh vien
	 * 
	 * @param array
	 *            Mang kieu doi tuong.
	 */
	static void printArray(Student[] array) {
		for (int i = 0; i < array.length; i++) {
			System.out.println("Sinh vien " + array[i].getName() + " diem " + array[i].getMark());
		}
	}
}
